package com.dayuanit.dy16.atm.mapper;

import com.dayuanit.dy16.atm.entity.Card;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

public interface CardMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Card record);

    int insertSelective(Card record);

    Card selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Card record);

    int updateByPrimaryKey(Card record);

    Card getByCardNum(String cardNum);

    int updateBalance(@Param("cardId") Long cardId,
                      @Param("newBalance") Integer newBalance,
                      @Param("oldBalance") Integer oldBalance);

    List<Card> listByUserId(Long userId);

    List<Card> listByIds(@Param("cardIds") Set<Long> cardIds);

    Card get4Lock(Long cardId);
}